package top.simonby.iron.plugin.data.jpa.util;

import org.springframework.data.jpa.domain.Specification;
import top.simonby.iron.plugin.data.jpa.query.SpecBaseQuery;
import top.simonby.iron.plugin.data.jpa.query.SpecGenerator;

/**
 * 生成查询Specification
 *
 * @author 91223
 */
public class SpecUtils {


    /**
     * 构建
     *
     * @param logicType
     * @param outerThis
     * @param <T>
     * @param <M>
     * @return
     */
    public static <T, M extends SpecBaseQuery<T>> Specification<T> builderSpecification(String logicType, M outerThis) {
        return new SpecGenerator.DefaultSpecGenerator<M>() {
        }.builderSpecification(logicType, outerThis);
    }
}
